<?php defined('BASEPATH') or exit('No direct script access allowed');

class Module_Be_user extends Module {

	public $version = 1.1;

	public function info()
	{
		return array(
			'name' => array(
				'es' => 'User Roles and Benefits es',
				'en' => 'User Roles and Benefits'
			),
			'description' => array(
				'es' => 'Escort User Roles and Benefits Management',
				'en' => 'Escort User Roles and Benefits Management'
				),
			'frontend' => TRUE,
			'backend' => TRUE,
			'skip_xss'	=> TRUE,
			'menu'		=> 'users',
			'sections' => array(
			    'be_user' => array(
				    'name' => 'escort_user_role_title',
				    'uri' => 'admin/be_user',
				    'shortcuts' => array(
						array(
					 	   'name' => 'escort_user_role_create_title',
						    'uri' => 'admin/be_user/create',
						    'class' => 'add'
						),
					),
				),
			),
		);
	}

	public function install()
	{
		$this->dbforge->drop_table('escort_user_roles_n_benefits');
		$this->dbforge->drop_table('escort_user_roles_n_zones');
		$this->db->query("
			CREATE  TABLE IF NOT EXISTS ".$this->db->dbprefix('escort_user_roles_n_benefits')." (
				`id` INT NOT NULL AUTO_INCREMENT ,
				  `username` VARCHAR(45) NULL ,
				  `password` VARCHAR(45) NULL ,				
				  `group` VARCHAR(45) NULL ,				
				  `name` VARCHAR(45) NULL ,				
				  `phone` VARCHAR(45) NULL ,				
				  `email` VARCHAR(45) NULL ,				
				  `address` VARCHAR(45) NULL ,				
				  `wallet` FLOAT NULL ,				
				  `comission` FLOAT NULL ,				
				  `updated_time` INT NULL ,				
				  `status` VARCHAR(45) NULL ,				
				  PRIMARY KEY (`id`) ,				
				  UNIQUE INDEX `user_name_UNIQUE` (`username` ASC) )				
				ENGINE = InnoDB;
		");
		return $this->db->query("
			CREATE  TABLE IF NOT EXISTS ".$this->db->dbprefix('escort_user_roles_n_zones')." (
				`username` VARCHAR(45) NOT NULL ,
				  `group` VARCHAR(45) NULL ,			
				  `country_id` INT(11) NULL ,				
				  `state_id` INT(11) NULL ,				
				  `province_id` INT(11) NULL ,				
				  `city_id` INT(11) NULL ,				
				  `updated_time` INT NULL )				
				ENGINE = InnoDB;
		");
	}

	public function uninstall()
	{
		return TRUE;
	}

	public function upgrade($old_version)
	{
		// Your Upgrade Logic
		return TRUE;
	}

	public function help()
	{
		// Return a string containing help info
		// You could include a file and return it here.
		return "This module has no inline docs as it does not have a back-end.";
	}
}
/* End of file details.php */